package com.learn.xmls.services;

import com.learn.xmls.daos.IXmlDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("xmlService")
public class XmlServiceImpl implements IXmlService {

    @Autowired
    private IXmlDao xmlDao;

    @Override
    public void save(String name) {
        xmlDao.save(name);
        System.out.println("xmlservice save: "+name);
    }

    @Override
    public String query(String id) {
        String s = xmlDao.query(id);
        System.out.println("xmlservice query: param="+id+" return="+s);
        throw new RuntimeException("自定义异常");
//        return "xmlservice query success";
    }
}
